﻿@{
    ViewBag.Title = "Index";
}
@using (Ajax.BeginForm("Index", "Home", new AjaxOptions
{
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "post",
    OnFailure = "fail",
    OnSuccess = "success",
    LoadingElementId = "lodeingmsg"
}, new { id = "form1" }))
{
    <div>输入内容：@Html.TextArea("txtBody")<input type="submit" id="btnOne" value="一元分词" />@Html.TextArea("txtResult")</div>
}
<div id="lodeingmsg" style="display: none;">加载中...</div>
<div id="msgDiv" style="color:red;"></div>
@section Scripts
{
    <script type="text/javascript">
        function fail(txt) { $("#msgDiv").html("查询失败，失败信息：" + txt.responseText); }
        function success(txt) { $("#txtResult").html(txt); }
    </script>
}

